﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucNH_BB.ascx.cs" Inherits="UC_ucNH_BB" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <div class="panel panel-success">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        Báo cáo nhập hàng theo bên bán
                        <asp:DropDownList ID="dlLoaiBaoCao" Visible="false" AutoPostBack="true" runat="server" Width="200px"
                            CssClass="form-control" OnSelectedIndexChanged="dlLoaiBaoCao_SelectedIndexChanged">
                            <asp:ListItem Text="BCNH tổng hợp"></asp:ListItem>
                            <asp:ListItem Text="BCNH bên chạy cước"></asp:ListItem>
                            <asp:ListItem Text="BCNH bên bán" Selected="True"></asp:ListItem>
                            <asp:ListItem Text="BCNH biển số xe"></asp:ListItem>
                            <asp:ListItem Text="BCNH loại vật liệu"></asp:ListItem>
                        </asp:DropDownList>
                        <%--<asp:Label ID="lbTrangThai" runat="server" Text="Trạng thái: Dữ liệu đang mở"></asp:Label>
                        <asp:Button ID="btnKhoa" CssClass="btn btn-warning" runat="server" Text="Khóa lại"
                            OnClick="btnKhoa_Click" />--%>
                    </h3>
                </div>
                <div class="panel-body">
                    <div>
                        <asp:DropDownList ID="dlThang" AutoPostBack="true" runat="server" Width="150px" CssClass="form-control"
                            OnSelectedIndexChanged="dlThang_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlNam" AutoPostBack="true" OnSelectedIndexChanged="dlThang_SelectedIndexChanged"
                            runat="server" Width="110px" CssClass="form-control">
                        </asp:DropDownList>
                        <asp:TextBox ID="txtTuNgay" runat="server" AutoPostBack="true" OnTextChanged="dlThang_SelectedIndexChanged"
                            placeholder="Từ ngày" Visible="true" Width="100px" CssClass="form-control"></asp:TextBox>&nbsp;
                        <asp:TextBox ID="txtDenNgay" runat="server" placeholder="Đến ngày" OnTextChanged="dlThang_SelectedIndexChanged"
                            AutoPostBack="true" Visible="true" Width="100px" CssClass="form-control"></asp:TextBox>
                        <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtTuNgay"
                            Format="dd/MM/yyyy">
                        </cc1:CalendarExtender>
                        <cc1:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtDenNgay"
                            Format="dd/MM/yyyy">
                        </cc1:CalendarExtender>
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender9" runat="server" FilterType="Custom,Numbers"
                            TargetControlID="txtTuNgay" ValidChars="/-" />
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender10" runat="server" FilterType="Custom,Numbers"
                            TargetControlID="txtDenNgay" ValidChars="/-" />
                        <asp:DropDownList ID="dlBenBan" ToolTip="Chọn bên bán" runat="server" AutoPostBack="true"
                            DataValueField="IDs" Width="220px" CssClass="form-control" 
                            DataTextField="TenNCC" onselectedindexchanged="dlBenBan_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlBenChayCuoc" ToolTip="Chọn bên chạy cước" runat="server" 
                            DataValueField="IDs" Width="220px" CssClass="form-control" DataTextField="TenNCC">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlTramTron" Visible="false" Enabled="false" ToolTip="Chọn trạm trộn" runat="server"
                            DataValueField="IDs" Width="150px" CssClass="form-control" DataTextField="TenTramTron">
                        </asp:DropDownList>
                        <asp:Button ID="btnXem" CssClass="btn btn-warning" runat="server" Text="Tìm kiếm"
                            OnClick="btnXem_Click" />
                        <asp:Button ID="btnSave" ValidationGroup="Them" runat="server" Style="margin-left: 5px;"
                            Text="Xuất báo cáo" CssClass="btn btn-primary" OnClick="btnPrint_Click" />
                        <asp:HiddenField ID="hdTuNgay" runat="server" />
                        <asp:HiddenField ID="hdDenNgay" runat="server" />
                    </div>
                    <div style="width: 100%; margin-top: 0px; overflow-x: auto;" class="wrapper">
                        <asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" ShowFooter="true" Width="2000px" CssClass="form-control withall"
                            OnRowCreated="GV_RowCreated">
                            <Columns>
                                <asp:BoundField DataField="SoPhieu" HeaderText="Số phiếu" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="NgayNhap" HeaderText="Ngày nhập" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="LoaiVL" ItemStyle-CssClass="paddingleft" HeaderText="Loại VL" />
                                <asp:BoundField DataField="BenBan" HeaderText="Bên bán" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="BenChayCuoc" HeaderText="Bên chạy cước" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="BienSo" HeaderText="Biển số" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="KLMuaVAT" HeaderText="có VAT" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="KLMuaKoVAT" HeaderText="không VAT" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="KLThucTe" HeaderText="KL thực tế" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="TLHang" HeaderText="TL hàng" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="KLSauQuiDoi" HeaderText="KL sau qui đổi" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="GiaVLCoVAT" HeaderText="có VAT" ItemStyle-HorizontalAlign="Right"
                                    DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="GiaVLKhongVAT" HeaderText="không VAT" ItemStyle-HorizontalAlign="Right"
                                    DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="ThanhTienVLCoVAT" HeaderText="có VAT" ItemStyle-HorizontalAlign="Right"
                                    DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="ThanhTienVLKhongVAT" HeaderText="không VAT" ItemStyle-HorizontalAlign="Right"
                                    DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="GiaCuocCoVAT" HeaderText="có VAT" ItemStyle-HorizontalAlign="Right"
                                    DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="GiaCuocKhongVAT" HeaderText="không VAT" ItemStyle-HorizontalAlign="Right"
                                    DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="ThanhTienCuocVCCoVAT" HeaderText="có VAT" ItemStyle-HorizontalAlign="Right"
                                    DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="ThanhTienCuocVCKhongVAT" HeaderText="không VAT" ItemStyle-HorizontalAlign="Right"
                                    DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="ThanhTien1m3CoVAT" HeaderText="có VAT" ItemStyle-HorizontalAlign="Right"
                                    DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="ThanhTien1m3KhongVAT" HeaderText="không VAT" ItemStyle-HorizontalAlign="Right"
                                    DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="ThanhTien1ChuyenCoVAT" HeaderText="có VAT" ItemStyle-HorizontalAlign="Right"
                                    DataFormatString="{0:0,0}" />
                                <asp:BoundField DataField="ThanhTien1ChuyenKhongVAT" HeaderText="không VAT" ItemStyle-HorizontalAlign="Right"
                                    DataFormatString="{0:0,0}" />
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Right" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                    </div>
                    <div style="margin: 5px;">
                        <asp:Button ID="btnFirst" runat="server" Text="Đầu" CssClass="btn btn-primary" OnClick="btnFirst_Click" />
                        <asp:Button ID="btnPre" runat="server" Style="margin-left: 5px;" Text="Trước" CssClass="btn btn-primary"
                            OnClick="btnPre_Click" />
                        <asp:Button ID="btnNext" runat="server" Style="margin-left: 5px;" Text="Sau" CssClass="btn btn-warning"
                            OnClick="btnNext_Click" />
                    </div>
                </div>
            </div>
            <asp:ValidationSummary ID="ValidationSummary1" HeaderText="Bạn phải nhập các trường sau:"
                        ShowMessageBox="true" ValidationGroup="Them" ShowSummary="false" EnableClientScript="true"
                        runat="server" />
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnSave" />
        </Triggers>
    </asp:UpdatePanel>